﻿using System.Net;

namespace JetBlack.AuthFeedBus.Distributor.Config
{
    /// <summary>
    /// The client configuration.
    /// </summary>
    public class Client
    {
        /// <summary>
        /// The IP address of the client.
        /// </summary>
        public readonly IPAddress IPAddress;

        /// <summary>
        /// The user name of the client.
        /// </summary>
        public readonly string User;

        /// <summary>
        /// The client roles this client may assume.
        /// </summary>
        public readonly ClientRole Allow;

        /// <summary>
        /// The client roles this client may not assume.
        /// </summary>
        public readonly ClientRole Deny;

        /// <summary>
        /// The constructor.
        /// </summary>
        /// <param name="ipAddress">The IP address of the client.</param>
        /// <param name="user">The user name of the client.</param>
        /// <param name="allow">The client roles the client may assume.</param>
        /// <param name="deny">The client roles the client may not assume.</param>
        public Client(IPAddress ipAddress, string user, ClientRole allow, ClientRole deny)
        {
            IPAddress = ipAddress;
            User = user;
            Allow = allow;
            Deny = deny;
        }
    }
}
